[Flex] Modify components that is not included in the current state?

Posted by user322896 on Stack Overflow See other posts from Stack Overflow or by user322896
Published on 2010-04-22T04:04:13Z Indexed on 2010/04/22 5:23 UTC
Read the original article Hit count: 127

Filed under:
|
|

In Flex 4, is it possible to modify components that is not include in the current state? For example, I have labelA included in stateA, how do I change the label text in stateB? If I directly change the label text in stateB, I'll get an null reference error message.

One workaround is to include labelA in all states, and set it to be invisible in states other than stateA. However, if the number of this kind of component goes too large, the work becomes tedious, and also I don't think it's reasonable to include unnecessary UI components in unrelated states. Is there better solution for this situation? Thanks!

Regards

© Stack Overflow or respective owner

Related posts about flex

Related posts about flex4